package com.py.web.controller;

import com.py.db.repository.PytestService;
import com.py.web.query.TestAO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by panying on 2018/2/27 0027.
 */
@Controller
@Api(value = "测试controller")
public class TestController {
    @Resource
    public PytestService pytestService;
    @RequestMapping(value = "/test",method = {RequestMethod.GET})
    @ResponseBody
    public String test(@RequestParam  String test){
        System.out.println(test);
        return  "test~~~";
    }
    @ApiOperation("查询实体测试")
    @ApiImplicitParams({
            @ApiImplicitParam(name="userName",value="用户名",dataType="string", paramType = "query"),
            @ApiImplicitParam(name="userPwd",value="用户i密码",dataType="long", paramType = "query")})
    @RequestMapping(value = "/testAo",method = {RequestMethod.GET})
    @ResponseBody
    public String testAo(@ModelAttribute TestAO testAO){
        System.out.println(testAO);
        return  "testao~~~";
    }

    @ApiOperation("测试dubbo")
    @RequestMapping(value = "/testDubbo",method = {RequestMethod.GET})
    @ResponseBody
    public String test(){
        System.out.println(pytestService.pyTestDubbo());
        return  "testdubbo~~~";
    }
}
